package com.example.im.db.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.im.bean.Accounts;

import java.util.List;

@Dao
public interface AccountsDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Long insert(Accounts account);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<Accounts> accounts);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    void update(Accounts account);

    @Delete
    void delete(Accounts account);

    @Query("SELECT * FROM Accounts LIMIT 1")
    Accounts account();

}
